package com.yq.cp.mapper.data;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yq.cp.entity.data.NengKongData;
import com.yq.cp.entity.data.dto.EnergyAnalyseArchDto;
import com.yq.cp.entity.data.dto.EnergyAnalyseListVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import javax.xml.crypto.Data;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 能控数据 Mapper 接口
 * </p>
 *
 * @author zh
 * @since 2023-03-20
 */
public interface NengKongDataMapper extends BaseMapper<NengKongData> {

    List<NengKongData> list(@Param("b") Date beginTime, @Param("o") Date overTime);
    List<NengKongData> list2(@Param("b") Date beginTime, @Param("o") Date overTime);
    @Delete("DELETE FROM t_neng_kong_data ")
    void deleteAll();

    /**
     * 查询累计最新的记录
     * */
    NengKongData queryNewestTotal(@Param("energy_code") String energy_code,@Param("name1") String name1,@Param("name2") String name2,@Param("b") Date b,@Param("v") Date v);
    /**
     * 查询累计倒数第二条的记录
     * */
    NengKongData queryNewestTotal222(@Param("energy_code") String energy_code,@Param("name1") String name1,@Param("name2") String name2,@Param("b") Date b,@Param("v") Date v);

    NengKongData queryNewestTotal2(@Param("energy_code") String energy_code,@Param("name1") String name1,@Param("name2") String name2,@Param("b") Date b,@Param("v") Date v,@Param("code") String macCode);

    /**
     * 精确匹配
     * */
    NengKongData queryNewestTotal1(@Param("energy_code") String energy_code,@Param("name") String name,@Param("b") Date b,@Param("v") Date v);

    /**
     * 查询每天平均值
     * */
    NengKongData queryNewestAvg(@Param("energy_code") String energy_code,@Param("name1") String name1,@Param("name2") String name2,@Param("b") Date b,@Param("v") Date v);

    List<EnergyAnalyseArchDto> list3(@Param("val") EnergyAnalyseListVo val);



}
